<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #login {
            margin: auto;
            width: 300px;
        }

        #login form {
            width: 100%;
        }

        #login form input {
            margin-top: 10px;
            width: 100%;
        }
    </style>
</head>

<body>
    <div id="login">
        <h1>Login</h1>
        <font th:text="${msg}" color="red"></font>
        <form action="/login" method="post">
            <input type="text" name="username" id=""><br>
            <input type="password" name="password" id="">
            <input type="submit" value="登陆">
            <a href="/register">注册</a>
        </form>
    </div>
    <script th:if="${msg}">
        alert('[[${msg}]]');
    </script>
</body>

</html>